﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using RiderShop.Mobile.Modle;
using Kevin.Shop.Business.Core.Components;
using Kevin.Shop.Business.Products.Components;
using Kevin.Shop.Business.Service.Entity.Products.Enumerations;
using System.Collections.Specialized;
using RiderShop.Mobile.Common.Component;
using Kevin.Shop.Business.Comments.Components;
using RiderShop.Mobile.Modle;
using RiderShop.Mobile.ServiceEntity.Product;
using Kevin.Shop.Business.Service.Entity.SalesManagement.Shipping;
using Kevin.Shop.Business.Core.Components.Responser;
using RiderShop.Mobile.ServiceEntity.MyAccount;
using Kevin.Shop.Business.Service.Entity.Helper;
using RiderShop.Mobile.ServiceEntity;

namespace RiderShop.Mobile.Controllers
{
    public partial class ContentController : ThemeController
    {
        #region ContentList
        public ActionResult ContentInfo()
        {
            ContentModel contentModel = new ContentModel();
            List<CategoryAndArticleInfoExtend> categoriesAndArticles = contentModel.GetCategoriesAndArticleInfo();
            if (categoriesAndArticles.Count > 0)
            {
                return View(WebClientContext.Current.SiteTheme, "Content", "ContentInfo", "_MobileLayout", categoriesAndArticles);
            }
            return View(WebClientContext.Current.SiteTheme, "Content", "ContentInfo", "_MobileLayout", null);
        }
        #endregion

        #region ContentDetail
        public ActionResult ContentDetail(int articleId)
        {
            ContentModel contentModel = new ContentModel();
            List<ArticleInfo> articles = contentModel.GetArticleInfo(articleId);
            if (articles.Count > 0)
            {
                return View(WebClientContext.Current.SiteTheme, "Content", "ContentDetail", "_MobileLayout", articles);
            }
            return View(WebClientContext.Current.SiteTheme, "Content", "ContentDetail", "_MobileLayout", null);
        }
        #endregion
    }
}
